//package com.etc.bridgeanalysis.stener;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.io.filefilter.FileFilterUtils;
//import org.apache.commons.io.filefilter.IOFileFilter;
//import org.apache.commons.io.monitor.FileAlterationMonitor;
//import org.apache.commons.io.monitor.FileAlterationObserver;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.io.File;
//
///**
// * @Author : DDS
// * @Description :
// * @Date: 2019-12-10 17:18
// */
//@Slf4j
//@Configuration
//public class FileConfig {
//
//    @Bean
//    void listen()  {
//
//        FileAlterationMonitor fileAlterationMonitor = new FileAlterationMonitor();
//        IOFileFilter filter = FileFilterUtils.or(FileFilterUtils.directoryFileFilter(), FileFilterUtils.fileFileFilter());
//        FileAlterationObserver fileAlterationObserver = new FileAlterationObserver(new File("C:\\ftproot"), filter);
//        FileListener fileListener = new FileListener();
//        fileAlterationObserver.addListener(fileListener);
//        fileAlterationMonitor.addObserver(fileAlterationObserver);
//        try {
//            fileAlterationMonitor.start();
//            log.debug("文件监听器启动了 ");
//        } catch (Exception e) {
//            log.debug("文件监听启动失败->{}",e.getMessage());
//        }
//
//    }
//
//}
